﻿using UnityEngine;
using pooling;

public class CoinAnimation : PoolingObject
{
    private readonly Vector3 endPosition = new Vector3(-4.5f,10,0);

    public void InitAnimation(Vector3 position)
    {
        transform.position = position;

        LeanTween.move(gameObject, endPosition, 1f).setEase(LeanTweenType.easeOutCubic).setOnComplete(() =>
        {
            OnRelease();
        });
    }
    
    public void InitAnimation2(Vector3 position)
    {
        transform.localPosition = position;

        LeanTween.moveLocal(gameObject, Vector3.zero, 1f).setEase(LeanTweenType.easeOutCubic).setOnComplete(() =>
        {
            OnRelease();
        });
    }
}
